package cn.tedu.community.commons.excepion;


import cn.tedu.community.commons.restful.ServiceCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用于处理自定义的Service类异常
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class ServiceException extends RuntimeException {
    private ServiceCode serviceCode;

    //构造方法
    public ServiceException(ServiceCode serviceCode, String message) {
        super(message);
        this.serviceCode = serviceCode;
    }

    public ServiceCode getServiceCode(){
        return serviceCode;
    }
}
